import request from '@/utils/request.js';

// patrol plan
export function patrolPlanGetService(search, currentPage, pageSize) {
    return request.get('/patrol/plan', { params: { search, currentPage, pageSize } })
}

export function patrolPlanCreateService(createData) {
    return request.post('/patrol/plan', createData)
}

export function patrolPlanEditService(editData) {
    return request.put('/patrol/plan', editData)
}

export function patrolPlanDeleteService(id) {
    return request.delete('/patrol/plan/' + id)
}

export function patrolPlanGetDutyService(patrolPlanId){
    return request.get('/patrol/plan/duty/' + patrolPlanId)
}

// patrol task
export function patrolTaskGetService(search, currentPage, pageSize) {
    return request.get('/patrol/task', { params: { search, currentPage, pageSize } })
}

export function patrolTaskSwitchCloseStatusService(id) {
    return request.put('/patrol/task/switchCloseStatus/' + id)
}

// employee patrol task
export function employeePatrolTaskGetService(employeeId, search, currentPage, pageSize) {
    return request.get('/patrol/employeeTask/' + employeeId, { params: { search, currentPage, pageSize } })
}

export function employeePatrolTaskHandleService(handleRemark, taskId) {
    return request.put('/patrol/handleTask', { handleRemark, taskId } )
}
